This invention relates to the field of computer graphics, and, more specifically, to optimizing the processing of light sources used in generating computer graphics images and animation.
Many computer graphic images are created by mathematically modeling the interaction of light with a three dimensional scene from a given viewpoint. This process, called rendering, generates a two-dimensional image of the scene from the given viewpoint, and is analogous to taking a photograph of a real-world scene. Animated sequences can be created by rendering a sequence of images of a scene as the scene is gradually changed over time. A great deal of effort has been devoted to making realistic looking rendered images and animations.
Surface attribute functions can define the values of attributes of surfaces in three-dimensional space. Surface attribute functions can be evaluated at any point on the surface to provide corresponding attribute values at that point on the surface. Attributes of surfaces can include optical properties of a surface, such as color, transparency, reflectivity, and refractivity. Attributes can also include visibility or occlusion information; artistically or procedurally generated texture data in one, two, three, or more dimensions; shadow generation information; illumination information, which specifies the amount and direction of light on the surface point from other portions of the scene; and rendering information, such as ray tracing path information or radiosity rendering information. Functions can be relatively simple, such as looking up texture data from a texture map, or very complex, such as the evaluation of complex user-defined shader programs, ray tracing programs, animation or modeling programs, or simulation programs.
An application such as a rendering or animation application determines pixel values in an image by evaluating or sampling a surface and its associated surface attribute functions. Surfaces can include triangles and polygons; higher-order surfaces such as B-splines; subdivision surfaces; and implicit surfaces, among others.
As part of the determination of a color attribute of a point (or points) on a surface, each light source in a set typically is evaluated to determine whether that light source contributes to the computed color value of that point. This determination entails identifying whether the light emitted from each light source is transmitted to the given point on the surface, whether the light is blocked by some other element of the object scene, and/or whether the light falls off (loses all intensity or ability to light an object) before reaching the surface. It further is possible that the light source is outside the frame or shot (multiple contiguous frames) of animation, or outside the view of a virtual camera viewing the set and determining the bounds of the frame(s), but still illuminates at least one surface in the frame or shot. Even further still, a light outside a frame might cast a shadow on an object or surface in the frame.
The process of rendering an image or frame of animation then can be a very time-consuming process, particularly where the set of object models for a scene includes hundreds or even thousands of lights. For example, a scene taking place in a sports stadium might have a thousand individual field lights scattered around the top of the stadium. There also can be hundreds or thousands of additional light sources, such as light sources representing flash bulbs of cameras in the stands, spotlights, or any other type of modeled light source or other source of illumination, such as the reflective surface of an object. When rendering a shot for such a set, the renderer typically must analyze each individual light source in the entire set to see how that source affects the objects or surfaces in the shot, even when the frame of the virtual camera for the shot only contains or pans over only a portion of the set. The analysis for each of the thousands of light sources can be very time consuming and data intensive.
In one example, analyzing the light sources at render time involves loading data for each light into memory. Since there is no way to know ahead of time if a light will affect a given frame or shot, it is necessary to do a determination for each individual light source for that set. This can involve, for example, doing ray tracing from each light source to determine if any objects are affected by the light source. For a camera flash, for example, it might be determined that the camera affects everything in front of the camera within about 50 feet (approximately based on image scale) of the flash. It then is necessary to do a ray tracing from the source of the flash, determine any interactions, and determine whether the interaction(s) are within the effective (or fallout) range of that light. These determinations need to be done not only for direct illumination, but other lighting such as reflections or casting of shadows. As rendering time is very costly, these additional lighting calculations can be very expensive.
It therefore is desirable to develop a methodology for quickly and automatically pruning lights in a given frame, group of frames, and/or shot of animation, thereby reducing rendering time without significantly increasing the time for lighting, preparation, or other processes.